package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.Work;
import com.ruoyi.system.service.IWorkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/work")
public class WorkController extends BaseController {
    @Autowired
    private IWorkService workService;

    /**
     * 全部查询
     * @return
     */
    @RequestMapping("/selectAll")
    public AjaxResult selectAll(){
        return success(workService.selectAll());
    }
    @PostMapping("/addWork")
    public AjaxResult addWork(@RequestBody Work work){
        return success(workService.addWork(work));
    }
    @PutMapping("/editWork")
    public AjaxResult editWork(@RequestBody Work work){
        return success(workService.editWork(work));
    }
    @DeleteMapping("/deleteWork/{workId}")
    public AjaxResult deleteWork(@PathVariable Long workId){
        return success(workService.deleteWork(workId));
    }
    @GetMapping("/selectData")
    public AjaxResult selectData(Work work){
        return success(workService.selectData(work));
    }


}
